package com.learn.mycollection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class TestCollections {

    public static void main(String[] args) {
        Collection coll = new ArrayList();
        coll.add(123);
        coll.add(456);
        coll.add("234");

        Iterator iterator = coll.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
            iterator.remove();
        }
        System.out.println(coll.size());
    }
}
